package cn.com.pansky.helper;

import javax.xml.namespace.QName;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

public class ZgssHelper {

	public static String zgssHttp(String businessId, String requestJson) throws Exception {
		System.out.println("职工请求接口："+businessId);
		String resultStr = "";
		Service s = new Service();
		Call call = (Call) s.createCall();
		call.setTimeout(new Integer(300000));//超时时间
		call.addParameter("businessId", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
		call.addParameter("jsonContent", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
		call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
		call.setUseSOAPAction(true);
		QName operationName = new QName("webservice", "atomService");
		call.setOperationName(operationName);
		//正式地址
//		call.setTargetEndpointAddress("");
		//测试环境地址
		call.setTargetEndpointAddress("http://10.189.128.14:8701/webservice/getAppService?wsdl");
		//本地连调地址
//		call.setTargetEndpointAddress("http://10.189./webservice/getAppService?wsdl");
		Object[] obj = new Object[] {businessId,requestJson};
		resultStr = (String) call.invoke(obj);
		System.out.println("职工接口返回："+resultStr);
		return resultStr;
	}
}
